<?php

$url = $this->context->id . '/' . $this->context->action->id;
?>
<?= \common\widgets\Asset::widget(['type'=>['summernote']])?>
    <style>
        legend {
            width: auto !important;
            border-style: none !important;
        }
        .layui-tab-brief>.layui-tab-title .layui-this a {
            color: #009688 !important;
        }
        .layui-field-title{
            margin: auto;
        }
        .delivery input{
            width: 20% !important;
            display: inline !important;
        }
        .form-group{
            font-size: larger;
        }
        .help-block{
            font-size: smaller;
        }
        input{
            font-size: medium !important;
        }
    </style>
    <div class="ui-layout-center ui-layout-pane">
        <div class="container-div">
            <div class="row">
                <div class="col-sm-12 search-collapse" style="display: block">
                    <div class="layui-card-body">
                        <div class="layui-collapse like-layui-collapse" lay-accordion=""
                             style="border:1px dashed #c4c4c4">
                            <div class="layui-colla-item">
                                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示<i
                                            class="layui-icon layui-colla-icon"></i></h2>
                                <div class="layui-colla-content layui-show">
                                    <p>*具体请仔细看配置说明；</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <form class="form-horizontal" id="form-config-site-site">
                        <fieldset class="layui-elem-field layui-field-title site-title">
                            <legend><a name="use">小程序</a></legend>
                        </fieldset>
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">小程序名称：</label>
                            <div class="col-sm-9">
                                <input type="text" name="name" value="<?= $model->name ?>" class="form-control"
                                       autocomplete="off" required>
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 此名称将在小程序首页顶部显示</span>
                            </div>
                        </div>
                        <?= \common\widgets\FormInput::widget(['name' => 'image|LOGO', 'extend' => ['link'=>'false','name' => 'imgarr1', 'id' => 'uploadimgbtn1', 'script_after' => '1', 'cat' => 'bmimage', 'water' => 'true', 'required' => 1, 'sm' => 2, 'data' => $model->logo]]) ?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">联系方式：</label>
                            <div class="col-sm-9">
                                <input type="text" name="contact_phone" value="<?= $model->contact_phone ?>"
                                       class="form-control" autocomplete="off" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">简介：</label>
                            <div class="col-sm-9">
                                <textarea class="form-control" name="intr" rows="3"><?= $model->intr ?></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">转发标题：</label>
                            <div class="col-sm-9">
                                <input type="text" name="forward_title" value="<?= $model->forward_title ?>"
                                       class="form-control" autocomplete="off">
                            </div>
                        </div>
                        <?= \common\widgets\FormInput::widget(['name' => 'image|转发封面', 'extend' => ['link'=>'false','name' => 'imgarr2', 'id' => 'uploadimgbtn2', 'script_after' => '2', 'cat' => 'bmimage', 'water' => 'true', 'sm' => 2, 'data' => $model->forward_cover]]) ?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分享标题：</label>
                            <div class="col-sm-9">
                                <input type="text" name="share_title" value="<?= $model->share_title ?>"
                                       class="form-control" autocomplete="off">
                            </div>
                        </div>
                        <?= \common\widgets\FormInput::widget(['name' => 'image|分享封面', 'extend' => ['link'=>'false','name' => 'imgarr3', 'id' => 'uploadimgbtn3', 'script_after' => '3', 'cat' => 'bmimage', 'water' => 'true', 'sm' => 2, 'data' => $model->share_cover]]) ?>
                        <input type="hidden" name="logo" id="img1">
                        <input type="hidden" name="forward_cover" id="img2">
                        <input type="hidden" name="share_cover" id="img3">
                        <fieldset class="layui-elem-field layui-field-title site-title">
                            <legend><a name="use">高德地图</a></legend>
                        </fieldset>
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">服务端KEY：</label>
                            <div class="col-sm-9">
                                <input type="text" name="service_map_key" value="<?= $model->service_map_key ?>"
                                       class="form-control" autocomplete="off" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">web端KEY：</label>
                            <div class="col-sm-9">
                                <input type="text" name="map_key" value="<?= $model->map_key ?>"
                                       class="form-control" autocomplete="off" required>
                            </div>
                        </div>
                        <fieldset class="layui-elem-field layui-field-title site-title">
                            <legend><a name="use">提现</a></legend>
                        </fieldset>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">最低提现金额：</label>
                            <div class="col-sm-9">
                                <input type="text" name="min_withdraw" value="<?= $model->min_withdraw ?>"
                                       class="form-control" autocomplete="off">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 不设置或设置成0，将不限制</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">打款方式：</label>
                            <div class="col-sm-9">
                                <?= \common\widgets\FormInput::widget(['name'=>'checkbox','extend'=>['value'=>$model->withdraw_way,'name'=>'withdraw_way[]','required'=>1,'data'=>$withdraw_way,'tips'=>'自动打款将使用企业付款到零钱，请在微信商户平台申请']])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">提现说明：</label>
                            <div class="col-sm-9">
                                <?= \common\widgets\FormInput::widget(['name' => 'textarea', 'extend' => ['height' => '500', 'name' => 'withdraw_explain', 'class' => 'withdraw_explain hide', 'info' => $model]]) ?>
                                <div class="withdraw_explain_summernote summernote" data-place=""><?=$model->withdraw_explain?></div>
                            </div>
                        </div>
                        <fieldset class="layui-elem-field layui-field-title site-title">
                            <legend><a name="use">提现</a></legend>
                        </fieldset>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">订单自动关闭时间：</label>
                            <div class="col-sm-9">
                                <input type="text" name="order_cancel" value="<?= $model->order_cancel ?>"
                                       class="form-control" autocomplete="off" style="width: 50%;display: inline"> 分钟
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 订单下单后x分钟内没有进行支付那么将在x分钟后自动关闭，不设置或设置成0，将不自动关闭，如果有优惠券使用请自行在后台订单列表点击取消订单</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">订单自动确认时间：</label>
                            <div class="col-sm-9">
                                <input type="text" name="order_receiv" value="<?= $model->order_receiv ?>"
                                       class="form-control" autocomplete="off" style="width: 50%;display: inline"> 天
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 订单在待确认状态时，如果在x天内没有确认，那么在x天后自动确认，不设置或设置成0，将不自动确认</span>
                            </div>
                        </div>
                        <div class="form-group text-center mt20">
                            <a href="javascript:;" class="btn btn-success btn-mid b5submit_btn"
                               data-target="form-config-site-site" data-title="确定提交基础设置"
                               data-url="<?= \yii\helpers\Url::to(['tran']) ?>">保存</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $this->beginBlock('script'); ?>
    <script>
        function b5submit_btn_before() {
            imgassign("input[name='imgarr1[]']", '#img1')
            imgassign("input[name='imgarr2[]']", '#img2')
            imgassign("input[name='imgarr3[]']", '#img3')
            var sHTML = $('.withdraw_explain_summernote').summernote('code');
            $(".withdraw_explain").val(sHTML);
            return true;
        }
    </script>
<?php $this->endBlock(); ?>